#!/bin/bash  

# 删除之前的产物
rm -rf tools/translation/export
rm android-language-export.zip

# 新建文件夹
mkdir tools/translation/export
mkdir tools/translation/export/res/
mkdir tools/translation/export/res/values
mkdir tools/translation/export/res/values-de
mkdir tools/translation/export/res/values-es
mkdir tools/translation/export/res/values-fr
mkdir tools/translation/export/res/values-it
mkdir tools/translation/export/res/values-ja
mkdir tools/translation/export/res/values-ko
mkdir tools/translation/export/res/values-pl
mkdir tools/translation/export/res/values-pt
mkdir tools/translation/export/res/values-ru
mkdir tools/translation/export/res/values-th
mkdir tools/translation/export/res/values-tr
mkdir tools/translation/export/res/values-vi
mkdir tools/translation/export/res/values-zh
mkdir tools/translation/export/res/values-zh-rHK
mkdir tools/translation/export/res/values-zh-rTW


currentdate=$(date +%Y%m%d)
xmlfilename="strings-archive.xml"

# 逐个把之前的翻译文件
cp appbase_custom/src/main/res/values/strings.xml tools/translation/export/res/values/strings.xml
cp appbase_custom/src/main/res/values-de/strings.xml tools/translation/export/res/values-de/strings.xml
cp appbase_custom/src/main/res/values-es/strings.xml tools/translation/export/res/values-es/strings.xml
cp appbase_custom/src/main/res/values-fr/strings.xml tools/translation/export/res/values-fr/strings.xml
cp appbase_custom/src/main/res/values-it/strings.xml tools/translation/export/res/values-it/strings.xml
cp appbase_custom/src/main/res/values-ja/strings.xml tools/translation/export/res/values-ja/strings.xml
cp appbase_custom/src/main/res/values-ko/strings.xml tools/translation/export/res/values-ko/strings.xml
cp appbase_custom/src/main/res/values-pl/strings.xml tools/translation/export/res/values-pl/strings.xml
cp appbase_custom/src/main/res/values-pt/strings.xml tools/translation/export/res/values-pt/strings.xml
cp appbase_custom/src/main/res/values-ru/strings.xml tools/translation/export/res/values-ru/strings.xml
cp appbase_custom/src/main/res/values-th/strings.xml tools/translation/export/res/values-th/strings.xml
cp appbase_custom/src/main/res/values-tr/strings.xml tools/translation/export/res/values-tr/strings.xml
cp appbase_custom/src/main/res/values-vi/strings.xml tools/translation/export/res/values-vi/strings.xml
cp appbase_custom/src/main/res/values-zh/strings.xml tools/translation/export/res/values-zh/strings.xml
cp appbase_custom/src/main/res/values-zh-rHK/strings.xml tools/translation/export/res/values-zh-rHK/strings.xml
cp appbase_custom/src/main/res/values-zh-rTW/strings.xml tools/translation/export/res/values-zh-rTW/strings.xml

mv appbase_custom/src/main/res/values/strings.xml "appbase_custom/src/main/res/values/"$xmlfilename
mv appbase_custom/src/main/res/values-de/strings.xml "appbase_custom/src/main/res/values-de/"$xmlfilename
mv appbase_custom/src/main/res/values-es/strings.xml "appbase_custom/src/main/res/values-es/"$xmlfilename
mv appbase_custom/src/main/res/values-fr/strings.xml "appbase_custom/src/main/res/values-fr/"$xmlfilename
mv appbase_custom/src/main/res/values-it/strings.xml "appbase_custom/src/main/res/values-it/"$xmlfilename
mv appbase_custom/src/main/res/values-ja/strings.xml "appbase_custom/src/main/res/values-ja/"$xmlfilename
mv appbase_custom/src/main/res/values-ko/strings.xml "appbase_custom/src/main/res/values-ko/"$xmlfilename
mv appbase_custom/src/main/res/values-pl/strings.xml "appbase_custom/src/main/res/values-pl/"$xmlfilename
mv appbase_custom/src/main/res/values-pt/strings.xml "appbase_custom/src/main/res/values-pt/"$xmlfilename
mv appbase_custom/src/main/res/values-ru/strings.xml "appbase_custom/src/main/res/values-ru/"$xmlfilename
mv appbase_custom/src/main/res/values-th/strings.xml "appbase_custom/src/main/res/values-th/"$xmlfilename
mv appbase_custom/src/main/res/values-tr/strings.xml "appbase_custom/src/main/res/values-tr/"$xmlfilename
mv appbase_custom/src/main/res/values-vi/strings.xml "appbase_custom/src/main/res/values-vi/"$xmlfilename
mv appbase_custom/src/main/res/values-zh/strings.xml "appbase_custom/src/main/res/values-zh/"$xmlfilename
mv appbase_custom/src/main/res/values-zh-rHK/strings.xml "appbase_custom/src/main/res/values-zh-rHK/"$xmlfilename
mv appbase_custom/src/main/res/values-zh-rTW/strings.xml "appbase_custom/src/main/res/values-zh-rTW/"$xmlfilename

cp tools/translation/strings.xml appbase_custom/src/main/res/values/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-de/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-es/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-fr/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-it/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-ja/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-ko/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-pl/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-pt/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-ru/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-th/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-tr/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-vi/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-zh/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-zh-rHK/strings.xml
cp tools/translation/strings.xml appbase_custom/src/main/res/values-zh-rTW/strings.xml

zip -q -r ./android-language-export.zip  tools/translation/export